import React, { Component } from "react";
import axios from "axios";

export default class App extends Component {
  constructor() {
    super();
    this.state = {
      filmList: [],
      info: "",
    };
    
  }
  componentDidMount(){
    axios.get(`/test.json`).then((res) => {
      console.log(res.data.data.films);
      this.setState({
        filmList: res.data.data.films,
      });
    });
  }
  render() {
    return (
      <div>
        {this.state.filmList.map((item) => {
          <FilmItem key={item.filmId} name={item.name}></FilmItem>;
        })}
      </div>
    );
  }
}
class FilmItem extends Component {
  render() {
    return <div>{this.props.name}</div>;
  }
}
